#ifndef LAURIN_IP_RANGE_H_
#define LAURIN_IP_RANGE_H_

#include <libnet.h>
#include <netinet/in.h>

class LaurinIPRange
{
	public:

		LaurinIPRange(const LaurinIPRange& range);

		static LaurinIPRange* getIPRange(u_int32_t networkAddrss, u_int32_t subnetMask);

		u_int32_t getFirstIPAddress() const;
		u_int32_t getLastIPAddress() const;
		u_int32_t getCurrentIPAddress() const;

		// cyclic order
		u_int32_t getNextIPAddress();

		int getNumbersOfIPAddress() const;

		void next();
		void reset();

	private:

		u_int32_t _start;
		u_int32_t _end;
		int _curOffset;
		int _nIPs;

		struct in_addr sTemp;
		struct in_addr _curIP;

		LaurinIPRange();

};

#endif
